package com.lxy.dataservice.controller;

import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.lxy.dataservice.entity.DurgType;
import com.lxy.dataservice.service.DurgTypeService;
import com.nip.db.mongodb.utils.tips.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * MemberController
 *
 * @author < a href=" ">BBB</ a>
 * @version v1.0.01
 * @date 2019-12-26 14:44
 */
@Component
public class DurgTypeController implements GraphQLQueryResolver, GraphQLMutationResolver {
  @Autowired
  DurgTypeService durgTypeService;

  public List<DurgType> findAllDurgType() {
    return durgTypeService.findAll();
  }

  public Response saveDurgType(DurgType entity) {
    return durgTypeService.saveDurgType(entity);
  }

  public DurgType findDurgTypeById(String id){
    return durgTypeService.findDurgTypeById(id);
  }

  public Response deleteDurgType(String id){
    return durgTypeService.deleteDurgType(id);
  }

  }
